package Sort;

public class SheelSort {
    public static void sort(int[] a){
        for (int gap = a.length >> 1; gap >= 1 ; gap = gap >> 1) {
            for (int low = gap; low < a.length ; low++) {
                int t = a[low];
                int i = low -gap;
                while (i >= 0 && t < a[i]){
                    a[i + gap] = a[i];
                    i -= gap;
                }
                a[i + gap] = t;
            }
        }
    }
}
